<template>
	<view class="container">
		<u--form ref="queryForm" :model="query">
			<u-form-item label="" prop="containerCode" style="display: flex;">
				<span style="margin-right: 20rpx;">容器码</span>
				<u--input
					placeholder="请输入/扫描"
					v-model="query.containerCode"
					suffixIcon="scan"
					suffixIconStyle="font-size: 68rpx"
					style="flex: 1;"
				>
				</u--input>
			</u-form-item>
		</u--form>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				query: {
					containerCode: ''
				}
			};
		},
		onLoad(options) {
			uni.$on('scancodedate',(data) => this.getCode(data.code))
		},
		onUnload() {  
			 // 移除监听事件      
			 uni.$off('scancodedate')
		},
		methods: {
			getCode(code) {
				this.query.containerCode = code
			}
		}
	}
</script>

<style lang="scss">

</style>
